﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Web.Models;

namespace Web.Controllers
{
    public class ProductController : Controller
    {

        private QUANLYSIEUTHI_LVEntities dbContext = new QUANLYSIEUTHI_LVEntities();
        //
        // GET: /Product/
      
        public ActionResult Index()
        {
            return View();
        }
   
        public ActionResult Details()
        {
            string productId = Request.QueryString["productId"].ToString();
            var query = from p in dbContext.SANPHAMs
                        where p.MaSP == productId
                        select p;
            var model = query.First();
            return PartialView("_Details", model);
        }

    }
}
